package org.emergency.framework.serviceImpl.common;

import javax.annotation.Resource;

import org.emergency.framework.dao.oa.ITbPermissionDAO;
import org.emergency.framework.model.contactDeptTree.EmergencyTree;
import org.emergency.framework.model.contactTree.TbPermissionTree;
import org.emergency.framework.service.common.ITbPermissionTreeService;
import org.springframework.stereotype.Repository;


@Repository("tbPermissionTreeServiceImpl")
public class TbPermissionTreeServiceImpl implements ITbPermissionTreeService{

	@Resource(name = "tbPermissionDAO")
	private ITbPermissionDAO dao;
	
	/**
	 * 把树从新从内存中加载
	 */
	public void updateTree() {
		 TbPermissionTree.updateTbPermissionTree(dao);
	}

	
	/**
	 * 得到Tree，一但触发这个或是上面的函数，TbPermissionTree就是被保存
	 * @return
	 */
	@Override
	public TbPermissionTree getTbRoleTreeTree() {
		// TODO Auto-generated method stub
		return TbPermissionTree.getInstance(dao);
	}


	/**
	 * reload
	 */
	@Override
	public void reloadTree() {
		// TODO Auto-generated method stub
		TbPermissionTree.reloadTree(dao);
	}
	
	
}
